<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线客服</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel=icon href="http://taoke.daihuo.com/favicon.ico">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.10/lib/index.css"/>
    <style type="text/css">
        body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td {
            margin: 0;
            padding: 0;
        }

        body, button, input, select, textarea {
            font: 12px/1.5 Microsoft YaHei, tahoma, arial, Hiragino Sans GB, \\5b8b\4f53, sans-serif;
        }

        h1, h2, h3, h4, h5, h6 {
            font-size: 100%;
        }

        address, cite, dfn, em, var {
            font-style: normal;
        }

        code, kbd, pre, samp {
            font-family: couriernew, courier, monospace;
        }

        small {
            font-size: 12px;
        }

        ul, ol {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        a:hover {
            text-decoration: none;
        }

        sup {
            vertical-align: text-top;
        }

        sub {
            vertical-align: text-bottom;
        }

        legend {
            color: #000;
        }

        fieldset, img {
            border: 0;
        }

        button, input, select, textarea {
            font-size: 100%;
        }

        table {
            border-collapse: collapse;
            border-spacing: 0;
        }

        *,
        *:before,
        *:after {
            box-sizing: border-box;
            margin: 0;
        }
        body, html {
            width: 100%;
            height: 100%;
            background: #F6F7FA;
        }
        .service-time {
            width: 100%;
            background: #FFF9DE;
            padding: 0.8vw 0;
            text-align: center;
            color: #7E6B13;
            font-size: 3.8vw;
        }
        .section-module {
            padding: 0 4vw;
            background: #fff;
            border-radius: 1.6vw;
            width: 94%;
            margin: 3vw auto;
            font-size: 0.24vw;
            color: #717076;
        }
        .section-module .header {
            padding: 2vw 0;
            text-align: center;
            position: relative;
        }
        .section-module .header h2 {
            color: #2B2C2E;
            font-size: 4.8vw;
            margin: 0;
            position: relative;
            z-index: 2;
        }
        .section-module .header .line {
            position: absolute;
            width: 20vw;
            height: 3vw;
            background: #FFD426;
            z-index: 1;
            left: 50%;
            margin-left: -10vw;
            margin-top: -3vw;
            border-radius: 1.6vw;
        }
        .section-module .header p {
            color: #717076;
            font-size: 3.4vw;
            margin-top: 1.2vw;
            margin-bottom: 0;
        }
        .service-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4vw 0;
            border-bottom: 0.2vw solid #EBEBEB;
        }
        .service-item:last-child {
            border-bottom: none;
        }
        .service-item p {
            color: #717076;
            font-size: 3.4vw;
        }
        .service-item .top {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 5vw;
        }
        .service-item .top p {
            color: #333333;
            font-size: 4vw;
        }
        .service-item .top .logo {
            width: 10vw;
            height: 10vw;
            border-radius: 50%;
        }
        .service-item .top .right {
            color: #333;
            font-size: 3.6vw;
            margin-left: 4vw;
        }
        .service-item .top .right .name {
            font-size: 4.4vw;
            font-weight: 600;
        }
        .service-item .top .right .name span {
            font-size: 3.4vw;
            font-weight: 500;
            color: #4D93FF;
            margin-left: 1vw;
        }
        .service-item .code {
            width: 28vw;
            height: 28vw;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="service-time">在线时间：周一到周六9:00-12:00、14:00-18:00</div>
    <div class="section-module">
        <div class="header">
            <h2>联系方式</h2>
            <i class="line"></i>
            <p>扫描下方二维码联系客服，即可在线沟通</p>
        </div>
        <div class="service-item">
            <div class="left">
                <div class="top">
                    <img class="logo" src="https://onecode-zfx-one.oss-cn-shenzhen.aliyuncs.com/20201112/7a4dff50-24b3-11eb-8929-6f27006081a1.png"/>
                    <div class="right">
                        <p>客服服务微信号</p>
                        <div class="name">
                            {{ wx }}
                            <span @click="onCopy(wx)">复制</span>
                        </div>
                    </div>
                </div>
                <p>扫描二维码或复制微信号添加客服</p>
            </div>
            <img class="code" :src="pic"/>
        </div>
    </div>
</div>

<!-- 引入 Vue 和 Vant 的 JS 文件 -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@2.10/lib/vant.min.js"></script>
<script>
    new Vue({
        el: '#app',
		data() {
			return {
				wx: null,
				pic: null
			}
		},
		created() {
			this.wx = this.getUrlParam('wx');
			this.pic = this.getUrlParam('pic');
		},
        methods: {
            onCopy(val) {
                let input = document.createElement("input"); // 直接构建input
                input.value = val; // 设置内容
                document.body.appendChild(input); // 添加临时实例
                input.select(); // 选择实例内容
                document.execCommand("Copy"); // 执行复制
                document.body.removeChild(input); // 删除临时实例

                vant.Toast('复制成功\n请前往微信添加客服');
            },
			getUrlParam(param) {
				let url = decodeURI(location.href);
				let paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
				let returnValue;
				for (let i = 0; i < paraString.length; i++) {
					let tempParas = paraString[i].split('=')[0];
					let parasValue = paraString[i].split('=')[1];
					if (tempParas === param)
						returnValue = parasValue;
				}
				if (typeof(returnValue) == "undefined") {
					return "";
				} else {
					return returnValue;
				}
			}
        }
    });
</script>
</body>
</html>